/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package arg_program;

import arg.program.gui.MainJFrame;

import java.io.File;
import java.util.ArrayList;
import java.util.Scanner;
import javax.swing.DefaultComboBoxModel;

/**
 *
 * @author Matsurika
 */
public class ReadGenreFile extends MainJFrame{
    
    DefaultComboBoxModel genreModel = new DefaultComboBoxModel();
    Scanner inputFile;
    
    public ReadGenreFile()
    {
        ReadFile();
    }
    public void ReadFile()
    {
        try
        {
            File genreFile = new File("genres.txt");
        
            inputFile = new Scanner(genreFile);
        
            while(inputFile.hasNext())
            {
                String line = inputFile.nextLine();
        
                genreModel.addElement(line);
            }
            
            genreCB.setModel(genreModel);
            inputFile.close();
        }
        catch(Exception ex)
        {
            System.out.println("Could not find the file.");
        }
    }    
}
